package com.ruoyi.sj.service.impl;

import java.util.List;
import java.util.Map;

import com.ruoyi.sj.domain.Comments;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.sj.mapper.DynamicMapper;
import com.ruoyi.sj.domain.Dynamic;
import com.ruoyi.sj.service.IDynamicService;
import com.ruoyi.common.support.Convert;

/**
 * 朋友圈动态 服务层实现
 * 
 * @author tyc@yanyu.com
 * @date 2018-11-28
 */
@Service
public class DynamicServiceImpl implements IDynamicService 
{
	@Autowired
	private DynamicMapper dynamicMapper;

	/**
     * 查询朋友圈动态信息
     * 
     * @param id 朋友圈动态ID
     * @return 朋友圈动态信息
     */
    @Override
	public Dynamic selectDynamicById(Long id)
	{
	    return dynamicMapper.selectDynamicById(id);
	}
	
	/**
     * 查询朋友圈动态列表
     * 
     * @param dynamic 朋友圈动态信息
     * @return 朋友圈动态集合
     */
	@Override
	public List<Dynamic> selectDynamicList(Dynamic dynamic)
	{
	    return dynamicMapper.selectDynamicList(dynamic);
	}
	
    /**
     * 新增朋友圈动态
     * 
     * @param dynamic 朋友圈动态信息
     * @return 结果
     */
	@Override
	public int insertDynamic(Dynamic dynamic)
	{
	    return dynamicMapper.insertDynamic(dynamic);
	}
	
	/**
     * 修改朋友圈动态
     * 
     * @param dynamic 朋友圈动态信息
     * @return 结果
     */
	@Override
	public int updateDynamic(Dynamic dynamic)
	{
	    return dynamicMapper.updateDynamic(dynamic);
	}

	/**
     * 删除朋友圈动态对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deleteDynamicByIds(String ids)
	{
		return dynamicMapper.deleteDynamicByIds(Convert.toStrArray(ids));
	}

	@Override
	public List<Comments> getConmmntList(Map mmp) {
		List<Comments> commentsList = dynamicMapper.getCommentsList(mmp);
		return commentsList;
	}

}
